package com.mzy.olddate.demo.stringprocessing;

import java.util.Arrays;
import java.util.List;

/**
 * @author Ives
 * * @date 2021/9/8
 */
public class CutOutString {
  public static void main(String[] args) {
//    demo1();
    demo2();

  }
  public static void demo1(){
    String ss="123456";
    System.out.println(ss.substring(3, 6));
    System.out.println(ss.substring(0, 3));
    System.out.println(ss.substring(3));
  }

  public static void demo2(){
    String ss="测试分类:层级1:层级2";
    String[] split = ss.split(":");
    List<String> strings = Arrays.asList(split);
    System.out.println(strings.get(0));
  }
}
